package design.patterns.factory.method;

/**
 * @author daxue0929
 * @date 2023/4/11
 */

public class CoffeeStore {

    private CoffeeFactory factory;

    public CoffeeStore setFactory(CoffeeFactory factory) {
        this.factory = factory;
        return this;
    }

    // 点咖啡的功能
    public Coffee orderCoffee(){
        Coffee coffee = factory.create();

        //加配料
        coffee.addMilk();
        coffee.addSugar();

        return coffee;
    }
}
